<script setup lang="ts">
import type { CodeMateModel, CodeMateTreeNode } from '@/apis/code/codeMateApi'

defineProps<{
  data: CodeMateTreeNode
}>()
</script>

<template>
  <div>
    <template v-if="data.type === 'project'">
      <div class="">
        项目
      </div>
    </template>
    <template v-if="data.type === 'module'">
      <div class="text-fuchsia-6">
        模块
      </div>
    </template>
    <template v-if="data.type === 'model'">
      <div v-if="(data.data as CodeMateModel).type === 'ENTITY'" class="text-green-6">
        模型
      </div>
      <div v-if="(data.data as CodeMateModel).type === 'DICT'" class="text-cyan">
        字典
      </div>
    </template>
    <template v-if="data.type === 'field'">
      <div class="mate-tree-tip text-red">
        字段
      </div>
    </template>
    <template v-if="data.type === 'method'">
      <div class="text-blue-5">
        方法
      </div>
    </template>
  </div>
</template>
